package com.mapreduce.partitioner;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Partitioner;

public class DeptPartitioner extends Partitioner<IntWritable,Employee> {


    public int getPartition(IntWritable intWritable, Employee employee, int numPartitions) {
        int deptNo = intWritable.get();
        int partition =0;
        switch (deptNo){
            case 10:
                partition=0;
                break;
            case 20:
                partition=1;
                break;
            case 30:
                partition=2;
                break;
        }

        return partition;
    }
}
